package com.base.myproject.client.HR.bcode;

import com.base.myproject.client.tools.Tools;
import com.base.myproject.client.ui.BaseJDBCPanel;
import com.base.myproject.client.ui.BaseOpenJSP;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;

public class RptDepLevel extends BaseJDBCPanel {
	
	private BaseOpenJSP jspPanel = null;
	private String jspFile = "";
	private Button toExcel = new Button("导出到EXCEL");
	public RptDepLevel(){
		init();
	}
	
	public void init(){
		initWidget();
	}
	
	public void complete() {
		super.complete();
		getToolbarll().add(print);
		getToolbarll().add(toExcel);
		
		print.addSelectionListener(new SelectionListener<ButtonEvent>() {
			@Override
			public void componentSelected(ButtonEvent ce) {
				Window.open(GWT.getHostPageBaseURL() + "hr_Jsp/departmentLevel.jsp","_blank",null);
			}
		});
	}
	
	public void initWidget(){
		toExcel.addSelectionListener(new SelectionListener<ButtonEvent>() {
			@Override
			public void componentSelected(ButtonEvent ce) {
				Window.open(GWT.getHostPageBaseURL() + "hr_Jsp/toexcel.jsp","_blank","menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes");
			}
		});
		
		jspFile = "hr_Jsp/departmentLevel.jsp";
		jspPanel = new BaseOpenJSP(jspFile);
		Tools.setResize(jspPanel, 0.99, 0.99);
		jspPanel.getFrame().getElement().setAttribute("frameborder", "0");
		add(jspPanel);
	}
}
